﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gota.Common.Context;

namespace Gota.Common.Entities.UI
{
    [Serializable]
    public class ResourceEntity
    {
        public int Id { get; set; }
        public string ResourceName { get; set; }
        public string ResourceTypeName { get; set; }
        public string PlugInName { get; set; }

        public static ResourceEntity FromDB(Resource gz)
        {
            ResourceEntity ge = new ResourceEntity
            {
                Id = gz.Id,
                ResourceName = gz.ResourceName,
                ResourceTypeName = gz.ResourceTypeName,
                PlugInName = gz.ResourceType.PlugIn.PlugInName
            };

            return ge;
        }
    }
}
